<template>
  <div id="app">
    <router-view v-slot="{ Component, route }">
      <component :is="Component" :key="route.path" />
    </router-view>
  </div>
</template>

<script setup>
import { onErrorCaptured } from 'vue'

// 全局错误捕获
onErrorCaptured((err, instance, info) => {
  console.error('Vue组件错误:', err)
  console.error('错误组件:', instance)
  console.error('错误信息:', info)
  return false // 继续传播错误
})
</script>

<style>
#app {
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
</style>
